<?PHP
if (!session_start()) { session_start(); };
/*if (!isset($_SESSION['lgnapproved'])) {
	die(header('Location: login.php'));
}*/

include("functions.php");
include("cnnxn.php");
connect();

if (isset($_POST['submit'])) {
	$combineddate=$_POST['eventdate_year'].'-'.$_POST['eventdate_month'].'-'.$_POST['eventdate_day'];
	
	$SQLadd='INSERT INTO Events (TournamentID,StartDate,GenderID,DivisionID,TeamSize,NumberOfTeams) VALUES ('.$_POST['TournamentID'].',"'.$combineddate.'",'.$_POST['GenderID'].','.$_POST['DivisionID'].','.$_POST['TeamSize'].','.$_POST['NumberOfTeams'].');';
	//print $SQLadd;
	$sendit_add=mysqli_query($db,$SQLadd) or die(mysqli_error($db));
	die(header("Location: Events_viewall.php?tid=".$_GET['tid']));
}
?>